#include"RBTree.hpp"
template<class K,class V> 
class map
{

	struct map_KeyofT
	{
		const K& operator()(const pair<K, V>& date)
		{
			return date.first;
		}
	};

public:
	typedef typename RBTree<K, pair<const K, V>, map_KeyofT>::Iterator Iterator;
	typedef typename RBTree<K, pair<K, V>, map_KeyofT>::Const_Iterator Const_Iterator;
	Iterator begin()
	{
		return _t.Begin();
	}
	Iterator end()
	{
		return _t.End();
	}

	pair<Iterator, bool> Insert(const pair<K,V>& date)
	{
		return _t.Insert(date);
	}
	void InOrder()
	{
		_t.InOrder();
	}
	V& operator[](const K& key)
	{
		return (_t.Insert(make_pair(key, V())).first)->second;
	}
private:
	RBTree<K, pair<K,V>, map_KeyofT> _t;
};